const joi = require('joi')

const title = joi.string().alphanum().min(3).required()
const cate_id = joi.number().integer().min(1)
const content = joi.string().required().allow('')
const state = joi.string().valid('已发布', '草稿').required()
const id = joi.number().integer().min(1).required()

exports.articles_schema = {
    body: {
        title,
        cate_id,
        content,
        state,
    }
}

exports.get_articles_schema = {
    params: {
        id,
    }
}

// exports.delete_articles_schema = {
//     params: {
//         id,
//     }
// }

exports.update_article_schema = {
    body: {
        title,
        cate_id,
        state,
        id,
    }
}